import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 切割
 * User: DELL
 * Date: 2024-05-09
 * Time: 14:43
 */
public class Main3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int W = scanner.nextInt();
        int H = scanner.nextInt();
        int temp = gcd(W, H);
        if (temp == 1) {
            System.out.println(0);
            return;
        }
        int i = 0;
        for (i = 2; i < Math.sqrt(temp); i++) {
            if (temp % i == 0) {
                break;
            }
        }
        long ans = 0;
        if (i < Math.sqrt(temp)) {
            ans = ((long) W / i) * ((long) H / i);
        } else {
            ans = ((long) W / temp) * ((long) H / temp);
        }
        System.out.println(ans);
    }

    private static int gcd(int num1, int num2) {
        if (num1 % num2 != 0) {
            return gcd(num2, num1 % num2);
        } else {
            return num2;
        }
    }
}
